package edu.zqu.collegeField.framework.activiti.service;




import org.activiti.engine.repository.Deployment;

import java.io.InputStream;
import java.util.zip.ZipInputStream;


public class ActivitiDeployment extends ActivitiBase {
    //流程定义部署  流程制作出来后要上传到服务器 zip文件更便于上传
    public static void deployment() {
        //3.转化出ZipInputStream流对象
        InputStream in = ActivitiDeployment.class.getClassLoader().getResourceAsStream("activiti/field_application.zip");
        //将 inputstream流转化为ZipInputStream流
        ZipInputStream zipInputStream = new ZipInputStream(in);

        //3.进行部署
        Deployment deployment = repositoryService.createDeployment()
                .addZipInputStream(zipInputStream)
                .name("场地申请流程")
                .deploy();
        /**
         * 4.输出部署的一些信息
         */
        System.out.println(deployment.getName());
        System.out.println(deployment.getId());
    }
}
